package com.education.basic.interceptor;

import com.education.basic.exception.BusinessException;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

/**
 */
public class ExceptionInterceptor extends AbstractInterceptor
{

	private static final long serialVersionUID = 8670627664085204410L;

	@Override
    public String intercept(ActionInvocation invocation) throws Exception
    {
        String result = "";
        try {
            result = invocation.invoke();
        } catch (Exception e) {
            if (e instanceof NullPointerException) {
                throw new BusinessException("");
            } else {
            }
        }
        return result;
    }
}
